package cn.redis;

import redis.clients.jedis.Jedis;

public class Test2 {

    public static Jedis jedis = new Jedis("127.0.0.1");


    public static void publish() {
        while(true) {
            //发布消息
            jedis.publish("newUserRequest", "Long Phone numbers........");
            try {
                Thread.currentThread().sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

    public static  void main(String args[])  {

        publish();

    }
}
